package cn.sportvip.entity.sport;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import cn.sportvip.entity.IdEntity;

/**
 * 场地
 * @author tao
 */
@Entity
@Table(name = "sport_gymnasium")
public class Gymnasium extends IdEntity {

	private static final long serialVersionUID = 1L;
	
	private String description;

	/** 教练 */
	@ManyToMany(targetEntity = Coach.class, fetch = FetchType.EAGER)
	@JoinTable(name = "join_gymnasium_coach", joinColumns = @JoinColumn(name = "gymnasium_id"), inverseJoinColumns = @JoinColumn(name = "coach_id"))
	private Set<Coach> coaches = new HashSet<Coach>(0);
	/** 课程 */
	@OneToMany(targetEntity = Course.class, fetch = FetchType.EAGER, mappedBy = "gymnasium")
	private Set<Course> courses = new HashSet<Course>(0);
	
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public Set<Coach> getCoaches() {
		return coaches;
	}
	public void setCoaches(Set<Coach> coaches) {
		this.coaches = coaches;
	}
	public Set<Course> getCourses() {
		return courses;
	}
	public void setCourses(Set<Course> courses) {
		this.courses = courses;
	}
}
